workspace.save_image_file: set dpi on image.save, #343#611
workspace.save_image_file: set dpi on image.save, #343#611
Conversation
bertsky
left a comment
There was a problem hiding this comment.
We should move this forward.
Looking up any existing image for DPI info (without making sure it's the original image) will work, as long as images only ever enter via this function (or some other DPI-preserving method).
Regarding (in)efficiency, we should immediately take action on the processor side, so the dpi kwarg is used everywhere.
(BTW, if we split this into the opt-in / dpi-kwarg and fallback / find_files part, we will get a window where we can adapt processors without paying the costs already.)
| dpi = (dpi, dpi) | ||
| elif not dpi: | ||
| # TODO - brittle, will this always find the original image? | ||
| orig_img_file = self.mets.find_files(pageId=page_id, mimetype='//^image')[0] |
There was a problem hiding this comment.
We must adapt for the generator now, I believe.
| orig_img_file = self.mets.find_files(pageId=page_id, mimetype='//^image')[0] | |
| orig_img_file = next(self.mets.find_files(pageId=page_id, mimetype='//^image', local_only=True)) |
|
Another idea I had: couldn't we at least try to force PIL.Image objects we ourselves produce ( |
No description provided.